import { S } from '../../../s';
import { IPSDEFVRCondition } from './ipsdefvrcondition';
import { IPSDEFVRGroupCondition } from './ipsdefvrgroup-condition';
import { PSDEFVRConditionImpl } from './psdefvrcondition-impl';

export class PSDEFVRGroupConditionImpl
  extends PSDEFVRConditionImpl
  implements IPSDEFVRGroupCondition
{
  get condOp(): 'AND' | 'OR' {
    return this.M.condOp;
  }

  protected psdefvrconditions: IPSDEFVRCondition[];
  getPSDEFVRConditions(): IPSDEFVRCondition[] | null {
    return (
      this.psdefvrconditions ||
      (this.psdefvrconditions = this.fillChildListModel(
        this.M.getPSDEFVRConditions,
        S._1c5,
      ) as IPSDEFVRCondition[])
    );
  }

  findPSDEFVRCondition(objKey: any): IPSDEFVRCondition | null {
    return this.getPSModel5(
      S._1c5,
      this.getPSDEFVRConditions(),
      objKey,
    ) as IPSDEFVRCondition;
  }
  get cls(): string {
    return 'PSDEFVRGroupConditionImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1c6) return true;
    return super.instanceof(cls);
  }
}
